/*
 * uart.h
 *
 * Created: 01.05.2012 13:34:24
 *  Author: Maxim Karban <maxim.karban@gmail.com>
 */ 


#ifndef UART_H_
#define UART_H_

#include <stdint.h>
#include "frsky.h"

#define FRSKY_NORMAL_BAUDRATE 9600UL

//for 7.xxMHz
//#define UBRR09600 0x002F
//for 4Mhz
//#define UBRR09600 0x0019

//#define ACTIVATE_FRSKY_TX UBRR0 = UBRR09600


#define UART_TX_DDR     DDRD
#define UART_RX_DDR     DDRD
#define UART_TX_PORT    PORTD
#define UART_RX_PORT    PORTD
#define UART_TX_PIN     1
#define UART_RX_PIN     0

extern void uartInit(bool tx_en, bool rx_en, uint16_t baud);

#endif /* UART_H_ */